/*
 *
 * Copyright ShangHai ECLUB Information Technology Co.,Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at

 * http://www.apache.org/licenses/LICENSE-2.0

 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *
 */

package com.eclub.emotion.rootstone.server.http.mapping;

import com.eclub.emotion.rootstone.server.http.HttpRequest;

/**
 * Interface to be implemented by objects that define a mapping between
 * requests and handler objects.
 *
 * @author   jun.yang, Wincor Nixdorf International GmbH
 */
public interface HandlerMapping {
	/**
	 * Return a handler for this request. The choice may be made
	 * on request URL
	 * <p>Returns <code>null</code> if no match was found. This is not an error.
	 * @param request RootStone HTTP Request
	 * @return a Object instance containing handler object , or <code>null</code> if no mapping found
	 * @throws Exception if there is an internal error
	 */
	Object getHandler(HttpRequest request) throws Exception;
}


